package cn.com.business.calculate;

import org.springframework.beans.factory.annotation.Autowired;

public class SecondFourCalculate extends AbstractCalculate {
	
	public SecondFourCalculate(AbstractCalculate calculate) {
		super(calculate);
	}

	@Override
	public void calculate() {
		
		if (super.getShopNum() >= 5 && super.getSalsNum() >= 30) {
			if ((super.getLeftIntegral() >= 150 * 500
					&& super.getRightIntegral() >= 150 * 500) || (super.getLeftIntegral() >= 100 * 500
							&& super.getRightIntegral() >= 200 * 500) || (super.getLeftIntegral() >= 200 * 500
									&& super.getRightIntegral() >= 100 * 500)) {
				super.setMoney(super.getMoney() + 12000);
				super.getIntegral().updateSELFIntegral(super.getSalesmanID(), 0, 0);
				super.getIntegral().updateThisIntegral(super.getSalesmanID(),0,0);
				
				super.setDescription("第二轮结算完成。");
				super.setCalculateProcess(0);
				super.next();
			}else{
				super.setDescription("结算第二轮第三阶段：左右美容院第一轮结算完剩余销售套数不足300套或者左右套数达不到比例的要求");
			}
		}else{
			super.setDescription("结算第二轮第四阶段：发展的美容院数不足5家或者报单数量没有达到30套");
		}

	}

}
